﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpWeb
{
    public class TextAreaTag : TagComponent
    {
        protected override string TagName
        {
            get
            {
                return "textarea";
            }
        }

        protected override bool CloseItSelf
        {
            get
            {
                return false;
            }
        }
        /// <summary>
        /// 规定文本区内的可见宽度。
        /// </summary>
        public string cols
        {
            get { return this.Attributes["cols"]; }
            set { this.Attributes["cols"] = value; }
        }

        /// <summary>
        /// 规定文本区内的可见行数。
        /// </summary>
        public string rows
        {
            get { return this.Attributes["rows"]; }
            set { this.Attributes["rows"] = value; }
        }
        /// <summary>
        /// 规定禁用该文本区。
        /// </summary>
        public string disabled
        {
            get { return this.Attributes["disabled"]; }
            set { this.Attributes["disabled"] = value; }
        }
        /// <summary>
        /// 规定文本区为只读。
        /// </summary>
        public string @readonly
        {
            get { return this.Attributes["readonly"]; }
            set { this.Attributes["readonly"] = value; }
        }

        private string _Content;
        /// <summary>
        /// 文本内容
        /// </summary>
        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }

        protected override void OnRenderContent(StringBuilder sb, ComponentContext context)
        {
            base.OnRenderContent(sb, context);
            sb.Append(this.Content);
        }

    }
}
